webpackJsonp([1],{

/***/ 297:
/***/ (function(module, exports, __webpack_require__) {

var disposed = false
var normalizeComponent = __webpack_require__(4)
/* script */
var __vue_script__ = __webpack_require__(364)
/* template */
var __vue_template__ = __webpack_require__(369)
/* template functional */
var __vue_template_functional__ = false
/* styles */
var __vue_styles__ = null
/* scopeId */
var __vue_scopeId__ = null
/* moduleIdentifier (server only) */
var __vue_module_identifier__ = null
var Component = normalizeComponent(
  __vue_script__,
  __vue_template__,
  __vue_template_functional__,
  __vue_styles__,
  __vue_scopeId__,
  __vue_module_identifier__
)
Component.options.__file = "resources/assets/js/views/cms/media/index.vue"

/* hot reload */
if (false) {(function () {
  var hotAPI = require("vue-loader/node_modules/vue-hot-reload-api")
  hotAPI.install(require("vue"), false)
  if (!hotAPI.compatible) return
  module.hot.accept()
  if (!module.hot.data) {
    hotAPI.createRecord("data-v-378066be", Component.options)
  } else {
    hotAPI.reload("data-v-378066be", Component.options)
  }
  module.hot.dispose(function (data) {
    disposed = true
  })
})()}

module.exports = Component.exports


/***/ }),

/***/ 303:
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});

var _waves = __webpack_require__(304);

var _waves2 = _interopRequireDefault(_waves);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var install = function install(Vue) {
  Vue.directive('waves', _waves2.default);
};

if (window.Vue) {
  window.waves = _waves2.default;
  Vue.use(install); // eslint-disable-line
}

_waves2.default.install = install;
exports.default = _waves2.default;

/***/ }),

/***/ 304:
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});

__webpack_require__(305);

exports.default = {
  bind: function bind(el, binding) {
    el.addEventListener('click', function (e) {
      var customOpts = Object.assign({}, binding.value);
      var opts = Object.assign({
        ele: el, // 波纹作用元素
        type: 'hit', // hit 点击位置扩散 center中心点扩展
        color: 'rgba(0, 0, 0, 0.15)' // 波纹颜色
      }, customOpts);
      var target = opts.ele;
      if (target) {
        target.style.position = 'relative';
        target.style.overflow = 'hidden';
        var rect = target.getBoundingClientRect();
        var ripple = target.querySelector('.waves-ripple');
        if (!ripple) {
          ripple = document.createElement('span');
          ripple.className = 'waves-ripple';
          ripple.style.height = ripple.style.width = Math.max(rect.width, rect.height) + 'px';
          target.appendChild(ripple);
        } else {
          ripple.className = 'waves-ripple';
        }
        switch (opts.type) {
          case 'center':
            ripple.style.top = rect.height / 2 - ripple.offsetHeight / 2 + 'px';
            ripple.style.left = rect.width / 2 - ripple.offsetWidth / 2 + 'px';
            break;
          default:
            ripple.style.top = (e.pageY - rect.top - ripple.offsetHeight / 2 - document.documentElement.scrollTop || document.body.scrollTop) + 'px';
            ripple.style.left = (e.pageX - rect.left - ripple.offsetWidth / 2 - document.documentElement.scrollLeft || document.body.scrollLeft) + 'px';
        }
        ripple.style.backgroundColor = opts.color;
        ripple.className = 'waves-ripple z-active';
        return false;
      }
    }, false);
  }
};

/***/ }),

/***/ 305:
/***/ (function(module, exports, __webpack_require__) {

// style-loader: Adds some css to the DOM by adding a <style> tag

// load the styles
var content = __webpack_require__(306);
if(typeof content === 'string') content = [[module.i, content, '']];
// Prepare cssTransformation
var transform;

var options = {}
options.transform = transform
// add the styles to the DOM
var update = __webpack_require__(98)(content, options);
if(content.locals) module.exports = content.locals;
// Hot Module Replacement
if(false) {
	// When the styles change, update the <style> tags
	if(!content.locals) {
		module.hot.accept("!!../../../../../node_modules/_css-loader@0.28.11@css-loader/index.js!./waves.css", function() {
			var newContent = require("!!../../../../../node_modules/_css-loader@0.28.11@css-loader/index.js!./waves.css");
			if(typeof newContent === 'string') newContent = [[module.id, newContent, '']];
			update(newContent);
		});
	}
	// When the module is disposed, remove the <style> tags
	module.hot.dispose(function() { update(); });
}

/***/ }),

/***/ 306:
/***/ (function(module, exports, __webpack_require__) {

exports = module.exports = __webpack_require__(6)(false);
// imports


// module
exports.push([module.i, ".waves-ripple {\n    position: absolute;\n    border-radius: 100%;\n    background-color: rgba(0, 0, 0, 0.15);\n    background-clip: padding-box;\n    pointer-events: none;\n    -webkit-user-select: none;\n    -moz-user-select: none;\n    -ms-user-select: none;\n    user-select: none;\n    -webkit-transform: scale(0);\n    -ms-transform: scale(0);\n    transform: scale(0);\n    opacity: 1;\n}\n\n.waves-ripple.z-active {\n    opacity: 0;\n    -webkit-transform: scale(2);\n    -ms-transform: scale(2);\n    transform: scale(2);\n    -webkit-transition: opacity 1.2s ease-out, -webkit-transform 0.6s ease-out;\n    transition: opacity 1.2s ease-out, -webkit-transform 0.6s ease-out;\n    transition: opacity 1.2s ease-out, transform 0.6s ease-out;\n    transition: opacity 1.2s ease-out, transform 0.6s ease-out, -webkit-transform 0.6s ease-out;\n}", ""]);

// exports


/***/ }),

/***/ 312:
/***/ (function(module, exports, __webpack_require__) {

var disposed = false
function injectStyle (ssrContext) {
  if (disposed) return
  __webpack_require__(313)
}
var normalizeComponent = __webpack_require__(4)
/* script */
var __vue_script__ = __webpack_require__(315)
/* template */
var __vue_template__ = __webpack_require__(316)
/* template functional */
var __vue_template_functional__ = false
/* styles */
var __vue_styles__ = injectStyle
/* scopeId */
var __vue_scopeId__ = "data-v-86d4bfbc"
/* moduleIdentifier (server only) */
var __vue_module_identifier__ = null
var Component = normalizeComponent(
  __vue_script__,
  __vue_template__,
  __vue_template_functional__,
  __vue_styles__,
  __vue_scopeId__,
  __vue_module_identifier__
)
Component.options.__file = "resources/assets/js/components/videoPicker.vue"

/* hot reload */
if (false) {(function () {
  var hotAPI = require("vue-loader/node_modules/vue-hot-reload-api")
  hotAPI.install(require("vue"), false)
  if (!hotAPI.compatible) return
  module.hot.accept()
  if (!module.hot.data) {
    hotAPI.createRecord("data-v-86d4bfbc", Component.options)
  } else {
    hotAPI.reload("data-v-86d4bfbc", Component.options)
  }
  module.hot.dispose(function (data) {
    disposed = true
  })
})()}

module.exports = Component.exports


/***/ }),

/***/ 313:
/***/ (function(module, exports, __webpack_require__) {

// style-loader: Adds some css to the DOM by adding a <style> tag

// load the styles
var content = __webpack_require__(314);
if(typeof content === 'string') content = [[module.i, content, '']];
if(content.locals) module.exports = content.locals;
// add the styles to the DOM
var update = __webpack_require__(8)("aa4010a8", content, false, {});
// Hot Module Replacement
if(false) {
 // When the styles change, update the <style> tags
 if(!content.locals) {
   module.hot.accept("!!../../../../node_modules/_css-loader@0.28.11@css-loader/index.js!../../../../node_modules/_vue-loader@13.7.3@vue-loader/lib/style-compiler/index.js?{\"vue\":true,\"id\":\"data-v-86d4bfbc\",\"scoped\":true,\"hasInlineConfig\":true}!../../../../node_modules/_sass-loader@6.0.7@sass-loader/lib/loader.js!../../../../node_modules/_vue-loader@13.7.3@vue-loader/lib/selector.js?type=styles&index=0!./videoPicker.vue", function() {
     var newContent = require("!!../../../../node_modules/_css-loader@0.28.11@css-loader/index.js!../../../../node_modules/_vue-loader@13.7.3@vue-loader/lib/style-compiler/index.js?{\"vue\":true,\"id\":\"data-v-86d4bfbc\",\"scoped\":true,\"hasInlineConfig\":true}!../../../../node_modules/_sass-loader@6.0.7@sass-loader/lib/loader.js!../../../../node_modules/_vue-loader@13.7.3@vue-loader/lib/selector.js?type=styles&index=0!./videoPicker.vue");
     if(typeof newContent === 'string') newContent = [[module.id, newContent, '']];
     update(newContent);
   });
 }
 // When the module is disposed, remove the <style> tags
 module.hot.dispose(function() { update(); });
}

/***/ }),

/***/ 314:
/***/ (function(module, exports, __webpack_require__) {

exports = module.exports = __webpack_require__(6)(false);
// imports


// module
exports.push([module.i, "\n.el-dialog__body[data-v-86d4bfbc] {\n  padding-top: 10px;\n  padding-left: 20px;\n  padding-right: 20px;\n}\n.image[data-v-86d4bfbc] {\n  width: auto;\n  height: auto;\n  max-width: 100%;\n  max-height: 100%;\n  margin: 0 auto;\n  display: block;\n}\n.card-img-top[data-v-86d4bfbc] {\n  height: 100px;\n  margin-top: 20px;\n}\n.time[data-v-86d4bfbc] {\n  font-size: 13px;\n  color: #999;\n  white-space: nowrap;\n  overflow: hidden;\n  text-overflow: ellipsis;\n}\n.bottom[data-v-86d4bfbc] {\n  margin-top: 13px;\n  line-height: 12px;\n}\n.button[data-v-86d4bfbc] {\n  padding: 0;\n  float: right;\n}\n.clearfix[data-v-86d4bfbc]:before,\n.clearfix[data-v-86d4bfbc]:after {\n  display: table;\n  content: \"\";\n}\n.clearfix[data-v-86d4bfbc]:after {\n  clear: both;\n}\n.shadow[data-v-86d4bfbc] {\n  -webkit-box-shadow: 0 0 2px 2px #1ab394 !important;\n          box-shadow: 0 0 2px 2px #1ab394 !important;\n}\n.checked[data-v-86d4bfbc] {\n  color: #1ab394;\n}\n.imginfo[data-v-86d4bfbc] {\n  white-space: nowrap;\n  overflow: hidden;\n  text-overflow: ellipsis;\n}\n", ""]);

// exports


/***/ }),

/***/ 315:
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
    value: true
});

var _auth = __webpack_require__(39);

var _waves = __webpack_require__(303);

var _waves2 = _interopRequireDefault(_waves);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

// Waves directive
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//

exports.default = {
    props: {
        stateManager: {
            type: Object
        },
        multiple: ''
    },
    directives: { waves: _waves2.default },
    data: function data() {
        return {
            list: this.$listDataSource({
                url: '/api/cms/video'
            }),
            imageRefreshList: true,
            isLoading: false,
            imgIndex: 0,
            activeName: 'image',
            isActive: '',
            //          是否清空标签栏
            isClear: '',
            interviewImg: {
                Listids: [],
                listthumbs: []
            },
            uploadAction: window.uploadHeaders,
            currentPage: 1,
            parameter: {
                type: 'image',
                tags: []
            },
            query: {
                page: 1,
                type: 'image',
                tags: []
            }
        };
    },
    methods: {
        checkedImg: function checkedImg(item, multiple) {
            if (multiple == true) {} else if (multiple == false) {
                this.interviewImg.Listids.splice(0);
                this.interviewImg.listthumbs.splice(0);
            }
            var ids = this.interviewImg.Listids.indexOf(item.id);
            if (ids >= 0) {
                //如果包含了该ID，则删除（单选按钮由选中变为非选中状态）
                this.interviewImg.Listids.splice(ids, 1);
                this.interviewImg.listthumbs.pop(item.path);
            } else {
                //选中该按钮
                this.interviewImg.Listids.push(item.id);
                this.interviewImg.listthumbs.push(item.path);
            }
            this.interviewImg.Listids.indexOf(item.id);
            this.$emit('submitPicture', this.interviewImg);
            this.closeDialog();
        },
        handleClick: function handleClick(type) {
            var self = this;
            self.query = {};
            self.parameter.type = type;
            self.query.type = self.parameter.type;
            self.imageRefreshList = true;
        },
        postTag: function postTag(e) {
            var self = this;
            console.log(e);
            self.parameter.tags = e;
            this.query.tags = self.parameter.tags;
            self.imageRefreshList = true;
        },

        uploadSuccessCallback: function uploadSuccessCallback(response, file) {
            //上传成功回调
            console.log(file);
            this.$message({
                message: '成功上传',
                type: 'success'
            });
            this.imageRefreshList = true;
        },
        uploadFailedCallback: function uploadFailedCallback(error, file) {
            //上传失败回调
            console.log(error);
            console.log(file);
            this.$Notice.error({
                title: '上传失败',
                desc: error
            });
        },
        handleBeforeUpload: function handleBeforeUpload(file) {
            var isJPG = void 0;
            switch (file.type) {
                case 'video/mp4':
                    isJPG = true;
                    break;
                default:
                    isJPG = false;
            }
            var isLt2M = file.size / 1024 / 1024 < 10;

            if (!isJPG) {
                this.$message.error('上传视频只能是 JPG/PNG 格式!');
            }
            if (!isLt2M) {
                this.$message.error('上传视频大小不能超过 10MB!');
            }
            return isJPG && isLt2M;
        },

        // 翻页
        handleCurrentChange: function handleCurrentChange(val) {
            this.currentPage = val;
            this.query.page = val;
            this.imageRefreshList = true;
        },

        closeDialog: function closeDialog() {
            this.stateManager.DialogVisible = false;
            this.interviewImg.Listids = [];
            this.interviewImg.listthumbs = [];
            this.isClear = true;
        }
    },
    computed: {
        modalTitle: function modalTitle() {
            return '选择视频';
        },
        tableList: function tableList() {
            var self = this;
            if (this.imageRefreshList) {
                this.list.fetch(self.query, function () {
                    self.imageRefreshList = false;
                });
            }
            return this.list;
        }
    },
    watch: {
        'stateManager.editModelId': function stateManagerEditModelId(newValue) {
            var self = this;
            this.model.fetch(newValue, {}, function () {
                self.stateManager.buttonLoading = false;
                self.stateManager.editDialogVisible = true;
            }, function () {
                self.stateManager.buttonLoading = false;
            });
        }
    }
};

/***/ }),

/***/ 316:
/***/ (function(module, exports, __webpack_require__) {

var render = function() {
  var _vm = this
  var _h = _vm.$createElement
  var _c = _vm._self._c || _h
  return _c(
    "div",
    { attrs: { id: "create-edit-container" } },
    [
      _c(
        "el-drawer",
        {
          ref: "drawer",
          attrs: {
            direction: "rtl",
            visible: _vm.stateManager.DialogVisible,
            title: _vm.modalTitle,
            "custom-class": "demo-drawer",
            size: "40%"
          },
          on: {
            "update:visible": function($event) {
              return _vm.$set(_vm.stateManager, "DialogVisible", $event)
            }
          }
        },
        [
          _c("div", { staticClass: "dialog-drawer-content" }, [
            _c(
              "div",
              { staticClass: "content", staticStyle: { flex: "1" } },
              [
                _c(
                  "div",
                  { staticClass: "filter-container" },
                  [
                    _c(
                      "el-upload",
                      {
                        ref: "upload",
                        attrs: {
                          action: "/api/cms/video",
                          multiple: "",
                          data: _vm.parameter,
                          headers: _vm.uploadAction,
                          "show-file-list": false,
                          "on-error": _vm.uploadFailedCallback,
                          "before-upload": _vm.handleBeforeUpload,
                          "on-success": _vm.uploadSuccessCallback
                        }
                      },
                      [
                        _c(
                          "el-button",
                          {
                            staticClass: "filter-item",
                            attrs: { size: "small", type: "primary" }
                          },
                          [
                            _vm._v("点击上传\n                            "),
                            _c("i", {
                              staticClass: "el-icon-upload el-icon--right"
                            })
                          ]
                        )
                      ],
                      1
                    )
                  ],
                  1
                ),
                _vm._v(" "),
                _c(
                  "el-table",
                  {
                    directives: [
                      {
                        name: "loading",
                        rawName: "v-loading",
                        value: _vm.stateManager.listLoading,
                        expression: "stateManager.listLoading"
                      }
                    ],
                    attrs: {
                      data: _vm.tableList.items,
                      border: "",
                      fit: "",
                      "highlight-current-row": "",
                      height: "700"
                    }
                  },
                  [
                    _c("el-table-column", {
                      attrs: {
                        prop: "name",
                        label: "文件名称",
                        align: "center"
                      }
                    }),
                    _vm._v(" "),
                    _c("el-table-column", {
                      attrs: { align: "center", prop: "tags", label: "标签" },
                      scopedSlots: _vm._u([
                        {
                          key: "default",
                          fn: function(scope) {
                            return [
                              _vm._l(scope.row.tags, function(item) {
                                return [
                                  _c(
                                    "el-tag",
                                    {
                                      staticStyle: { "margin-right": "5px" },
                                      attrs: { size: "mini" }
                                    },
                                    [_vm._v(_vm._s(item))]
                                  )
                                ]
                              })
                            ]
                          }
                        }
                      ])
                    }),
                    _vm._v(" "),
                    _c("el-table-column", {
                      attrs: { label: "操作", width: "230", align: "center" },
                      scopedSlots: _vm._u([
                        {
                          key: "default",
                          fn: function(scope) {
                            return [
                              _c("el-button", {
                                directives: [
                                  { name: "waves", rawName: "v-waves" }
                                ],
                                attrs: { size: "mini", icon: "fa fa-check" },
                                on: {
                                  click: function($event) {
                                    return _vm.checkedImg(
                                      scope.row,
                                      _vm.multiple
                                    )
                                  }
                                }
                              })
                            ]
                          }
                        }
                      ])
                    })
                  ],
                  1
                )
              ],
              1
            ),
            _vm._v(" "),
            _c("div", { staticClass: "dialog-drawer-footer" }, [
              _c("div", { staticClass: "dialog-drawer-footer row" }, [
                _c(
                  "div",
                  { staticClass: "col" },
                  [
                    _c("el-pagination", {
                      attrs: {
                        background: "",
                        layout: "prev, pager, next,total",
                        "page-size": 18,
                        total: _vm.list.total,
                        "current-page": _vm.currentPage
                      },
                      on: { "current-change": _vm.handleCurrentChange }
                    })
                  ],
                  1
                )
              ])
            ])
          ])
        ]
      )
    ],
    1
  )
}
var staticRenderFns = []
render._withStripped = true
module.exports = { render: render, staticRenderFns: staticRenderFns }
if (false) {
  module.hot.accept()
  if (module.hot.data) {
    require("vue-loader/node_modules/vue-hot-reload-api")      .rerender("data-v-86d4bfbc", module.exports)
  }
}

/***/ }),

/***/ 364:
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});

var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; //
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//

var _vuex = __webpack_require__(38);

var _dialog2 = __webpack_require__(365);

var _dialog3 = _interopRequireDefault(_dialog2);

var _waves = __webpack_require__(303);

var _waves2 = _interopRequireDefault(_waves);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

// Waves directive
exports.default = {
  directives: { waves: _waves2.default },
  components: {
    'el-dialog': _dialog3.default
  },
  data: function data() {
    return {
      stateManager: {
        refreshList: true,
        editDialogVisible: false,
        editModelId: null,
        listLoading: true,
        buttonLoading: false
      },
      query: {
        keyword: '',
        category_id: '',
        page: 1,
        include: 'index'
      },
      list: this.$listDataSource({
        url: '/api/cms/media'
      }),
      model: this.$modelDataSource({
        url: '/api/cms/media',
        dataKey: 'model',
        attributes: {
          id: ''
        }
      }),
      currentPage: 1
    };
  },
  created: function created() {
    this.$store.commit('setPageTitle', '视频管理');
    this.$store.dispatch('fetchCategoryList');
  },

  methods: {
    showEditDialog: function showEditDialog(id) {
      this.stateManager.editDialogVisible = true;
      this.stateManager.editModelId = id;
      this.stateManager.buttonLoading = false;
    },
    handleFilter: function handleFilter() {
      this.query.page = 1;
      this.stateManager.refreshList = true;
    },

    // 翻页
    handleCurrentChange: function handleCurrentChange(val) {
      this.currentPage = val;
      this.query.page = val;
      this.stateManager.refreshList = true;
    },
    handleDelete: function handleDelete(id) {
      var self = this;
      this.$confirm('是否删除此项？', {
        confirmButtonText: '确认',
        cancelButtonText: '取消',
        type: 'warning',
        title: '删除确认'
      }).then(function () {
        self.model.uuid = id;
        self.model.destroy(function () {
          self.stateManager.refreshList = true;
          self.$message.success('删除成功');
        });
      }).catch(function (res) {
        console.log(res.response);
      });
    }
  },
  computed: _extends({}, (0, _vuex.mapGetters)(['categoryList']), {
    tableList: function tableList() {
      var self = this;
      if (this.stateManager.refreshList) {
        this.stateManager.listLoading = true;
        this.$store.dispatch('fetchTags');
        this.list.fetch(self.query, function () {
          self.stateManager.refreshList = false;
          self.stateManager.listLoading = false;
        });
      }
      return this.list;
    }
  })
};

/***/ }),

/***/ 365:
/***/ (function(module, exports, __webpack_require__) {

var disposed = false
var normalizeComponent = __webpack_require__(4)
/* script */
var __vue_script__ = __webpack_require__(366)
/* template */
var __vue_template__ = __webpack_require__(367)
/* template functional */
var __vue_template_functional__ = false
/* styles */
var __vue_styles__ = null
/* scopeId */
var __vue_scopeId__ = null
/* moduleIdentifier (server only) */
var __vue_module_identifier__ = null
var Component = normalizeComponent(
  __vue_script__,
  __vue_template__,
  __vue_template_functional__,
  __vue_styles__,
  __vue_scopeId__,
  __vue_module_identifier__
)
Component.options.__file = "resources/assets/js/views/cms/media/_dialog.vue"

/* hot reload */
if (false) {(function () {
  var hotAPI = require("vue-loader/node_modules/vue-hot-reload-api")
  hotAPI.install(require("vue"), false)
  if (!hotAPI.compatible) return
  module.hot.accept()
  if (!module.hot.data) {
    hotAPI.createRecord("data-v-3632a0d3", Component.options)
  } else {
    hotAPI.reload("data-v-3632a0d3", Component.options)
  }
  module.hot.dispose(function (data) {
    disposed = true
  })
})()}

module.exports = Component.exports


/***/ }),

/***/ 366:
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});

var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; //
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//

var _vuex = __webpack_require__(38);

var _cms = __webpack_require__(99);

var _videoPicker = __webpack_require__(312);

var _videoPicker2 = _interopRequireDefault(_videoPicker);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

exports.default = {
  props: {
    stateManager: {
      type: Object
    }
  },
  components: {
    'video-picker': _videoPicker2.default
  },
  data: function data() {
    return {
      model: this.$modelDataSource({
        url: '/api/cms/media',
        dataKey: 'model',
        attributes: {
          id: 0,
          title: '',
          assets_id: null,
          tags: [],
          is_auto: 0,
          category: [],
          thumbnail_path: ''
        }
      }),
      manager: { DialogVisible: false },
      contentSelectList: [],
      typeArr: ['无', '单页', '列表', '外链'],
      isLoading: false,
      ruleValidate: {
        title: [{ required: true, message: '请填写视频标题', trigger: 'blur' }],
        category: [{ required: true, message: '请选择栏目', trigger: ['blur', 'array'] }],
        point_category_id: [{ required: true, type: 'array', message: '请选择指向栏目', trigger: 'change' }],
        point_content_id: [{ required: true, type: 'integer', message: '请选择指向内容', trigger: 'change' }],
        point_url: [{ required: true, message: '请选择指向地址不能为空', trigger: 'blur' }]
      }

    };
  },
  methods: {
    closeDialog: function closeDialog() {
      if (this.stateManager.buttonLoading) {
        return false;
      }
      this.stateManager.editDialogVisible = false;
      this.stateManager.listLoading = false;
      this.model.reset();
      this.$refs['model'].resetFields();
      this.stateManager.editModelId = 0;
    },
    imgPick: function imgPick() {
      this.manager.DialogVisible = true;
    },

    getPicture: function getPicture(e) {
      this.model.assets_id = e.Listids[0];
      this.model.thumbnail_path = e.listthumbs[0];
    },
    ContentList: function ContentList() {
      var _this = this;

      this.contentSelectList = [];
      if (this.model.point_category_id && this.model.point_type == 1) {
        (0, _cms.getContentsByCategory)(this.model.point_category_id).then(function (res) {
          _this.contentSelectList = res.data;
        });
        return this.contentSelectList;
      }
    },

    saveModel: function saveModel() {
      var self = this;
      self.$refs['model'].validate(function (valid) {
        if (valid) {
          if (self.stateManager.editModelId == 0) {
            self.model.parent_id = self.stateManager.parentId;
          }
          self.isLoading = false;
          self.stateManager.buttonLoading = true;
          self.model.save(function () {
            self.$message.success('保存成功');
            self.stateManager.refreshList = true;
            self.stateManager.buttonLoading = false;
            self.closeDialog();
          }, function (errors) {
            self.stateManager.buttonLoading = false;
            self.isLoading = false;
          });
        } else {
          console.log('表单验证失败');
        }
      });
    }
  },
  computed: _extends({}, (0, _vuex.mapGetters)(['tags', 'categoryList']), {
    modalTitle: function modalTitle() {
      switch (this.stateManager.editModelId) {
        case 0:
          return '添加视频';
          break;
        default:
          return '编辑视频';
      }
    }
  }),
  watch: {
    'stateManager.editModelId': function stateManagerEditModelId(newValue) {
      var self = this;
      this.model.fetch(newValue, { include: 'update' }, function () {
        self.stateManager.editDialogVisible = true;
      }, function () {
        self.stateManager.listLoading = false;
      });
    }
  }
};

/***/ }),

/***/ 367:
/***/ (function(module, exports, __webpack_require__) {

var render = function() {
  var _vm = this
  var _h = _vm.$createElement
  var _c = _vm._self._c || _h
  return _c(
    "div",
    { attrs: { id: "create-edit-container" } },
    [
      _c(
        "el-drawer",
        {
          ref: "drawer",
          attrs: {
            direction: "rtl",
            visible: _vm.stateManager.editDialogVisible,
            title: _vm.modalTitle,
            "custom-class": "demo-drawer",
            "before-close": _vm.closeDialog
          },
          on: {
            "update:visible": function($event) {
              return _vm.$set(_vm.stateManager, "editDialogVisible", $event)
            }
          }
        },
        [
          _c(
            "div",
            { staticClass: "dialog-drawer-content" },
            [
              _c(
                "el-form",
                {
                  ref: "model",
                  attrs: { model: _vm.model, rules: _vm.ruleValidate }
                },
                [
                  _c(
                    "el-row",
                    { attrs: { type: "flex", gutter: 20 } },
                    [
                      _c(
                        "el-col",
                        { attrs: { span: 12 } },
                        [
                          _c(
                            "el-form-item",
                            { attrs: { label: "视频标题", prop: "title" } },
                            [
                              _c("el-input", {
                                attrs: { placeholder: "请填写视频标题" },
                                model: {
                                  value: _vm.model.title,
                                  callback: function($$v) {
                                    _vm.$set(_vm.model, "title", $$v)
                                  },
                                  expression: "model.title"
                                }
                              })
                            ],
                            1
                          )
                        ],
                        1
                      ),
                      _vm._v(" "),
                      _c(
                        "el-col",
                        { attrs: { span: 12 } },
                        [
                          _c(
                            "el-form-item",
                            { attrs: { label: "栏目", prop: "category" } },
                            [
                              _c("el-cascader", {
                                staticStyle: { width: "100%" },
                                attrs: {
                                  props: {
                                    multiple: true,
                                    checkStrictly: true,
                                    label: "name",
                                    children: "children",
                                    value: "id"
                                  },
                                  options: _vm.categoryList,
                                  "collapse-tags": "",
                                  clearable: "",
                                  placeholder: "请选择栏目"
                                },
                                model: {
                                  value: _vm.model.category,
                                  callback: function($$v) {
                                    _vm.$set(_vm.model, "category", $$v)
                                  },
                                  expression: "model.category"
                                }
                              })
                            ],
                            1
                          )
                        ],
                        1
                      )
                    ],
                    1
                  ),
                  _vm._v(" "),
                  _c(
                    "el-row",
                    { attrs: { type: "flex", gutter: 20 } },
                    [
                      _c(
                        "el-col",
                        { attrs: { span: 12 } },
                        [
                          _c(
                            "el-form-item",
                            { attrs: { label: "标签", prop: "tags" } },
                            [
                              _c(
                                "el-select",
                                {
                                  staticStyle: { width: "100%" },
                                  attrs: {
                                    filterable: "",
                                    multiple: "",
                                    "allow-create": "",
                                    placeholder: "请选择标签"
                                  },
                                  model: {
                                    value: _vm.model.tags,
                                    callback: function($$v) {
                                      _vm.$set(_vm.model, "tags", $$v)
                                    },
                                    expression: "model.tags"
                                  }
                                },
                                _vm._l(_vm.tags, function(item, key) {
                                  return _c("el-option", {
                                    key: key,
                                    attrs: {
                                      label: item.label,
                                      value: item.label
                                    }
                                  })
                                }),
                                1
                              )
                            ],
                            1
                          )
                        ],
                        1
                      ),
                      _vm._v(" "),
                      _c(
                        "el-col",
                        { attrs: { span: 12 } },
                        [
                          _c(
                            "el-form-item",
                            {
                              attrs: { label: "是否自动播放", prop: "is_auto" }
                            },
                            [
                              _c(
                                "el-select",
                                {
                                  staticStyle: { width: "100%" },
                                  model: {
                                    value: _vm.model.is_auto,
                                    callback: function($$v) {
                                      _vm.$set(_vm.model, "is_auto", $$v)
                                    },
                                    expression: "model.is_auto"
                                  }
                                },
                                [
                                  _c("el-option", {
                                    attrs: { label: "是", value: 1 }
                                  }),
                                  _vm._v(" "),
                                  _c("el-option", {
                                    attrs: { label: "否", value: 0 }
                                  })
                                ],
                                1
                              )
                            ],
                            1
                          )
                        ],
                        1
                      )
                    ],
                    1
                  ),
                  _vm._v(" "),
                  _c(
                    "el-row",
                    { attrs: { type: "flex", gutter: 20 } },
                    [
                      _c(
                        "el-col",
                        { attrs: { span: 12 } },
                        [
                          _c("el-form-item", {
                            attrs: { label: "视频素材", prop: "assets_id" }
                          }),
                          _vm._v(" "),
                          _c("div", { staticClass: "image-picker" }, [
                            _c(
                              "div",
                              {
                                staticClass: "el-upload",
                                on: { click: _vm.imgPick }
                              },
                              [
                                _vm.model.assets_id
                                  ? _c("img", {
                                      staticClass: "avatar",
                                      attrs: { src: __webpack_require__(368) }
                                    })
                                  : _vm._e()
                              ]
                            )
                          ])
                        ],
                        1
                      )
                    ],
                    1
                  )
                ],
                1
              ),
              _vm._v(" "),
              _c("video-picker", {
                attrs: { stateManager: _vm.manager, multiple: false },
                on: { submitPicture: _vm.getPicture }
              }),
              _vm._v(" "),
              _c(
                "div",
                { staticClass: "dialog-drawer-footer" },
                [
                  _c(
                    "el-button",
                    {
                      attrs: { type: "ghost" },
                      on: { click: _vm.closeDialog }
                    },
                    [_vm._v("取消")]
                  ),
                  _vm._v(" "),
                  _c(
                    "el-button",
                    {
                      attrs: {
                        type: "primary",
                        loading: _vm.stateManager.buttonLoading
                      },
                      on: { click: _vm.saveModel }
                    },
                    [
                      _vm._v(
                        _vm._s(
                          _vm.stateManager.buttonLoading ? "提交中" : "确定"
                        )
                      )
                    ]
                  )
                ],
                1
              )
            ],
            1
          )
        ]
      )
    ],
    1
  )
}
var staticRenderFns = []
render._withStripped = true
module.exports = { render: render, staticRenderFns: staticRenderFns }
if (false) {
  module.hot.accept()
  if (module.hot.data) {
    require("vue-loader/node_modules/vue-hot-reload-api")      .rerender("data-v-3632a0d3", module.exports)
  }
}

/***/ }),

/***/ 368:
/***/ (function(module, exports) {

module.exports = "/images/video.png?11189fd4a75954bb53fe8722447feabe";

/***/ }),

/***/ 369:
/***/ (function(module, exports, __webpack_require__) {

var render = function() {
  var _vm = this
  var _h = _vm.$createElement
  var _c = _vm._self._c || _h
  return _c(
    "div",
    { staticClass: "app-container" },
    [
      _c(
        "div",
        { staticClass: "filter-container" },
        [
          _c("el-input", {
            staticClass: "filter-item",
            staticStyle: { width: "260px" },
            attrs: { placeholder: "请输入查询信息" },
            nativeOn: {
              keyup: function($event) {
                if (
                  !$event.type.indexOf("key") &&
                  _vm._k($event.keyCode, "enter", 13, $event.key, "Enter")
                ) {
                  return null
                }
                return _vm.handleFilter($event)
              }
            },
            model: {
              value: _vm.query.keyword,
              callback: function($$v) {
                _vm.$set(_vm.query, "keyword", $$v)
              },
              expression: "query.keyword"
            }
          }),
          _vm._v(" "),
          _c("el-cascader", {
            staticClass: "filter-item",
            attrs: {
              props: { label: "name", children: "children", value: "id" },
              options: _vm.categoryList,
              "show-all-levels": true,
              clearable: true,
              filterable: true,
              "change-on-select": "",
              placeholder: "请选择栏目"
            },
            model: {
              value: _vm.query.category_id,
              callback: function($$v) {
                _vm.$set(_vm.query, "category_id", $$v)
              },
              expression: "query.category_id"
            }
          }),
          _vm._v(" "),
          _c(
            "el-button",
            {
              directives: [{ name: "waves", rawName: "v-waves" }],
              staticClass: "filter-item",
              attrs: { type: "primary", icon: "el-icon-search" },
              on: { click: _vm.handleFilter }
            },
            [_vm._v("查询")]
          ),
          _vm._v(" "),
          _c(
            "el-button",
            {
              staticClass: "filter-item",
              staticStyle: { "margin-left": "0" },
              attrs: { type: "primary", icon: "el-icon-edit" },
              on: {
                click: function($event) {
                  return _vm.showEditDialog(0)
                }
              }
            },
            [_vm._v(" 添加\n        ")]
          )
        ],
        1
      ),
      _vm._v(" "),
      [
        _c(
          "el-table",
          {
            directives: [
              {
                name: "loading",
                rawName: "v-loading",
                value: _vm.stateManager.listLoading,
                expression: "stateManager.listLoading"
              }
            ],
            staticStyle: { width: "100%", "min-height": "75vh" },
            attrs: {
              data: _vm.tableList.items,
              border: "",
              fit: "",
              "highlight-current-row": ""
            }
          },
          [
            _c("el-table-column", {
              attrs: { prop: "title", label: "视频标题" }
            }),
            _vm._v(" "),
            _c("el-table-column", {
              attrs: { align: "center", width: "200px", label: "自动播放" },
              scopedSlots: _vm._u([
                {
                  key: "default",
                  fn: function(scope) {
                    return [
                      _c(
                        "el-tag",
                        {
                          staticStyle: { "margin-right": "5px" },
                          attrs: { size: "mini" }
                        },
                        [_vm._v(_vm._s(scope.row.is_auto ? "是" : "否"))]
                      )
                    ]
                  }
                }
              ])
            }),
            _vm._v(" "),
            _c("el-table-column", {
              attrs: {
                align: "center",
                prop: "categories",
                width: "200px",
                label: "栏目"
              },
              scopedSlots: _vm._u([
                {
                  key: "default",
                  fn: function(scope) {
                    return [
                      _vm._l(scope.row.categories, function(item) {
                        return [
                          _c(
                            "el-tag",
                            {
                              staticStyle: { "margin-right": "5px" },
                              attrs: { size: "mini" }
                            },
                            [_vm._v(_vm._s(item.name))]
                          )
                        ]
                      })
                    ]
                  }
                }
              ])
            }),
            _vm._v(" "),
            _c("el-table-column", {
              attrs: { label: "操作", width: "230", align: "center" },
              scopedSlots: _vm._u([
                {
                  key: "default",
                  fn: function(scope) {
                    return [
                      _c("el-button", {
                        directives: [{ name: "waves", rawName: "v-waves" }],
                        attrs: {
                          size: "mini",
                          type: "success",
                          icon: "el-icon-edit-outline"
                        },
                        on: {
                          click: function($event) {
                            return _vm.showEditDialog(scope.row.id)
                          }
                        }
                      }),
                      _vm._v(" "),
                      _c("el-button", {
                        directives: [{ name: "waves", rawName: "v-waves" }],
                        attrs: {
                          size: "mini",
                          type: "danger",
                          icon: "el-icon-delete"
                        },
                        on: {
                          click: function($event) {
                            return _vm.handleDelete(scope.row.id)
                          }
                        }
                      })
                    ]
                  }
                }
              ])
            })
          ],
          1
        ),
        _vm._v(" "),
        _c(
          "div",
          { staticClass: "pagination-container" },
          [
            _c("el-pagination", {
              attrs: {
                background: "",
                layout: "prev, pager, next,total",
                "page-size": 15,
                total: _vm.list.total,
                "current-page": _vm.list.currentPage
              },
              on: { "current-change": _vm.handleCurrentChange }
            })
          ],
          1
        )
      ],
      _vm._v(" "),
      _c("el-dialog", { attrs: { stateManager: _vm.stateManager } })
    ],
    2
  )
}
var staticRenderFns = []
render._withStripped = true
module.exports = { render: render, staticRenderFns: staticRenderFns }
if (false) {
  module.hot.accept()
  if (module.hot.data) {
    require("vue-loader/node_modules/vue-hot-reload-api")      .rerender("data-v-378066be", module.exports)
  }
}

/***/ })

});